//渲染底部导航
function box(obj) {
	let body = document.querySelector("body");
	body.innerHTML += `
	<ul class="footer dpflex jub">
		<li>
		<span class="iconfont ${
			obj == "home" ? "active" : ""
		}" >  &#xe624 </span> <span><a href="./home.html">首页</a></span>
		</li>
		<li><span class="iconfont  ${
			obj == "exercise" ? "active" : ""
		}"> &#xe62e </span><span><a href="./exercise.html">首页</a></span></li>
		<li><span class="iconfont  ${
			obj == "circle" ? "active" : ""
		}"> &#xe62a  </span><span><a href="./circle.html">首页</a></span></li>
		<li><span class="iconfont ${
			obj == "mine" ? "active" : ""
		}"> &#xe62f </span><span><a href="./mine.html">首页</a></span></li>
	</ul>`;
}
box();
//封装页尾跳转
// function PageFooting(a, b, c, d) {
// 	let li = document.querySelectorAll(".footer li");
// 	console.log(li);
// 	li.forEach((v, i) => {
// 		v.addEventListener("click", function () {
// 			// location.href = `./${v}.html`;
// 			console.log(v, i, "1111");
// 			if (i === 0) {
// 				location.href = `./${a}.html`;
// 			} else if (i === 1) {
// 				location.href = `./${b}.html`;
// 			} else if (i === 2) {
// 				location.href = `./${c}.html`;
// 			} else if (i === 3) {
// 				location.href = `./${d}.html`;
// 			}

// 		});
// 	});
// }
// PageFooting("home", "exercise", "circle", "mine");
/**
 * 单个获取元素
 * 两种暴露方式
 */
// export const $ = (sel) => {
// 	return document.querySelector(sel);
// };

// /**
//  * 多个获取元素
//  */
// export const $a = (sel) => {
// 	return document.querySelectorAll(sel);
// };
module.exports = {
	/**
	 * 单个获取元素
	 */
	$(sel) {
		return document.querySelector(sel);
	},

	/**
	 * 多个获取元素
	 */
	$a(sel) {
		return document.querySelectorAll(sel);
	},
	box,
};
